﻿<%@ Page Language="C#" MasterPageFile="~/InventoryTracker/MasterPage.master" AutoEventWireup="true" CodeFile="InvoiceDetails.aspx.cs" Inherits="InventoryTracker_InvoiceDetails" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="maincontent" Runat="Server">

    <div id="projectreport">
        <a name="content_start0" id="content_start0"></a>
        <fieldset>
            <h2 class="none">
                Invoice Details</h2>
            <legend>Invoice Details</legend>
            <div class="formsection">
                Invoice Details</div>
             
                
            <table >
            </table>     
                
            <table style="width: 1155px; top: 514px; left: 29px; position: absolute; height: 105px" >
            <tr>
             <td style="width: 192px"> 
             <p>
                
                        <asp:Label ID="lblInvoiceItemName" runat="server" Text="Item Name"></asp:Label>
                        <br />
                        <asp:DropDownList ID="ddrInvoiceItemName" runat="server" 
                            DataSourceID="MItNaDS" DataTextField="ItemName" 
                            DataValueField="ItemCode" Height="22px" Width="128px" AutoPostBack="True"></asp:DropDownList>
                        <asp:SqlDataSource ID="MItNaDS" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:TimeTrackerConnectionString11 %>" 
                            SelectCommand="SELECT * FROM [MaterialMaster]"></asp:SqlDataSource>
                        
                    </p>
             
              </td>
              
              <td style="width: 160px">
              
              <p>
                        <asp:Label ID="lblItemDes" runat="server" Text="Description"></asp:Label>
                        <br />
                        <asp:DropDownList ID="ddrItemDes" runat="server" 
                            DataSourceID="MItDesDS" DataTextField="ItemDescription" 
                            DataValueField="ItemDescription" Height="22px" Width="128px" 
                            AutoPostBack="True"></asp:DropDownList>
                      
                        
                        <asp:SqlDataSource ID="MItDesDS" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:TimeTrackerConnectionString %>" 
                            SelectCommand="SELECT * FROM [MaterialMaster]"></asp:SqlDataSource>
                      
                        
            </p>
              </td>
              
              
              <td style="width: 160px">
              
              <p>
                        <asp:Label ID="lblInvoiceItemRate" runat="server" Text="Unit Rate"></asp:Label>
                        <br />
                        <asp:DropDownList ID="ddrInvoiceItemRate" runat="server" 
                            DataSourceID="MItRatDS" DataTextField="SellingRate" 
                            DataValueField="SellingRate" Height="22px" Width="128px" 
                            AutoPostBack="True"></asp:DropDownList>
                      
                        <asp:SqlDataSource ID="MItRatDS" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:TimeTrackerConnectionString %>" 
                            SelectCommand="SELECT * FROM [MaterialMaster]"></asp:SqlDataSource>
            </p>
              </td>
              
              <td style="width: 112px">
              
              <p style="width: 160px; height: 44px">
                        <asp:Label ID="lblInvoiceItemQty" runat="server" Text="Item Quantity"></asp:Label>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtInvoiceItemQty"
                        ErrorMessage="*" ></asp:RequiredFieldValidator>
                            
                            
                         <asp:TextBox ID="txtInvoiceItemQty" runat="server"></asp:TextBox>   
                            
                            
                    </p>
              </td>
              <td>
              
              <p style="width: 160px; height: 44px">
                        <asp:Label ID="lblAmount" runat="server" Text="Amount"></asp:Label>
                            
                           
                         <asp:TextBox ID="txtAmount" runat="server" AutoPostBack="True" ></asp:TextBox>   
                            
                            
                    </p>
              </td>
              <td>
              
              <p style="width: 160px">
                        <asp:Label ID="lblInvDetTax" runat="server" Text="Tax"></asp:Label>
                        <br />
                        <asp:DropDownList ID="ddrInvDetTax" runat="server" 
                            DataSourceID="TaxDS" DataTextField="TaxName" DataValueField="TaxID" 
                            Height="22px" Width="128px"></asp:DropDownList>
                        
                        <asp:SqlDataSource ID="TaxDS" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:TimeTrackerConnectionString12 %>" 
                            SelectCommand="SELECT * FROM [TaxScheme]"></asp:SqlDataSource>
                        
                    </p>
              
              </td>
              <td>
              <p style="width: 160px; height: 44px">
                        
                        <asp:Label ID="lblInvoiceDiscount" runat="server" Text="Discount"></asp:Label>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="txtInvoiceDiscount"
                        ErrorMessage="*" ></asp:RequiredFieldValidator>
                        <br />
                        <asp:TextBox ID="txtInvoiceDiscount" runat="server" AutoPostBack="True"></asp:TextBox>
                    </p>
              </td>
              
              <td style="width: 159px">
              <p style="width: 160px; height: 44px">
                        <asp:Label ID="lblInvoiceTotalAmount" runat="server" Text="Total Amount"></asp:Label>
                        
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtInvoiceTotalAmount"
                        ErrorMessage="*" ></asp:RequiredFieldValidator>
                        
                        <asp:TextBox ID="txtInvoiceTotalAmount" runat="server"></asp:TextBox>
                    </p>
              </td>
            </tr>
            </table>     
                  
                    <asp:Button ID="btnInsert" runat="server" Text="INSERT" 
                
                style="top: 885px; position: absolute; height: 26px; width: 68px; left: 712px" 
                onclick="btnInsert_Click"></asp:Button>  
            
            <table style="top: 163px; left: 1023px; position: absolute; height: 48px; width: 174px">
<tr>
<td>

<p style="width: 170px; height: 44px">
                        <asp:Label ID="lblDateTime" runat="server" Text="Date"></asp:Label>
                        
                          <br />                
                        <asp:TextBox ID="txtDateTime" runat="server" 
                            ontextchanged="txtDateTime_TextChanged" AutoPostBack="True" 
                            Enabled="False"></asp:TextBox>
                        </p>

<p style="width: 170px; height: 44px">
                        <asp:Label ID="lblPlace" runat="server" Text="Place"></asp:Label>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtPlace"
                        ErrorMessage="*" ></asp:RequiredFieldValidator>
                          <br />                
                        <asp:TextBox ID="txtPlace" runat="server"></asp:TextBox>
                        </p>



</td>
</tr>
</table>
<p>
            
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                CellPadding="4" DataSourceID="InvSource1" ForeColor="#333333" 
                GridLines="None" AllowPaging="True" AllowSorting="True" 
                 PageSize="5" 
                
                style="margin-right: 0px; top: 624px; left: 27px; position: absolute; width: 1186px;" 
                Height="218px">
                <RowStyle BackColor="#EFF3FB" />
                <Columns>
<asp:BoundField DataField="InvoiceItem" HeaderText="Item Name" SortExpression="InvoiceItem"></asp:BoundField>
                    <asp:BoundField DataField="InvoiceItemRate" HeaderText="Unit Rate" 
                        SortExpression="InvoiceItemRate" />
                    <asp:BoundField DataField="InvoiceItemQty" HeaderText="Quantity" 
                        SortExpression="InvoiceItemQty" />
                    <asp:BoundField DataField="Tax" HeaderText="Tax" 
                        SortExpression="Tax" />
                    <asp:BoundField DataField="InvoiceDiscount" HeaderText="Discount" 
                        SortExpression="InvoiceDiscount" />
                    <asp:BoundField DataField="InvoiceTotalAmount" HeaderText="Total Amount" 
                        SortExpression="InvoiceTotalAmount" />
                    <asp:BoundField DataField="InvoiceDate" HeaderText="Date" 
                        SortExpression="InvoiceDate" />
                </Columns>
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                <EmptyDataTemplate>
                    <a Href="javascript:__doPostBack('GridView1','Sort$InvoiceItem')" 
                        style="color:White;">InvoiceItem</a>
                </EmptyDataTemplate>
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <EditRowStyle BackColor="#2461BF" />
                <AlternatingRowStyle BackColor="White" />
            </asp:GridView>
            
            
</p>
<p style="top: 880px; left: 23px; position: absolute; height: 31px; width: 1334px">
<asp:SqlDataSource ID="InvSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:TimeTrackerConnectionString13 %>" 
                
                SelectCommand="SELECT [InvoiceItem], [InvoiceItemRate], [Tax], [InvoiceTotalAmount], [InvoiceDate], [InvoiceItemQty], [InvoiceDiscount] FROM [InvoiceDetails] WHERE ([InvoiceNumber] = @InvoiceNumber)">
                <SelectParameters>
                    <asp:ControlParameter ControlID="ddrInvNo" Name="InvoiceNumber" 
                        PropertyName="SelectedValue" Type="Int32" />
                </SelectParameters>
            </asp:SqlDataSource>


</p>
            
            <div class="formsection">
                <asp:Button ID="btnInvDetSubmit" runat="server"  Text="Submit" 
                    onclick="btnInvDetSubmit_Click" onclientclick="return true"  />
                    
                    
                    <asp:Label ID="lblResult" runat="server" Text=""></asp:Label>
                    
            </div>
              
            
                 
            <table style="width: 437px; top: 153px; left: 31px; position: absolute; bottom: 56px;">
            <tr>
            
            <td style="width: 237px">    
                <p style="top: 5px; left: 4px; position: absolute; height: 66px; width: 194px">
                        <asp:Label ID="lblInvNo" runat="server" Text="Invoice No."></asp:Label>
                        <br />
                    <asp:DropDownList ID="ddrInvNo" runat="server" DataSourceID="InvNoDataSource1" 
                            DataTextField="InvoiceNumber" DataValueField="InvoiceNumber" Height="22px" 
                            Width="128px" AutoPostBack="True"></asp:DropDownList>
                    
                        <asp:SqlDataSource ID="InvNoDataSource1" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:TimeTrackerConnectionString14 %>" 
                            SelectCommand="SELECT * FROM [Invoice]"></asp:SqlDataSource>
                                                   
           </td>
            
            <br />
                <td >
                    <p style="top: 77px; left: 5px; position: absolute; height: 97px; width: 231px" >
                        <asp:Label ID="lblCustID" runat="server" Text="Customer ID"></asp:Label>
                        <br />
                            <asp:DropDownList ID="ddrCustID1" runat="server" 
                            DataSourceID="CustID1DS" DataTextField="CustName" 
                            DataValueField="CustID" Height="22px" Width="128px" AutoPostBack="True"></asp:DropDownList>
                            
                        <asp:SqlDataSource ID="CustID1DS" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:TimeTrackerConnectionString6 %>" 
                            SelectCommand="SELECT * FROM [CustomerMaster]"></asp:SqlDataSource>
                            
                        
                    
                        <asp:DetailsView ID="CustDetailsView1" runat="server" AutoGenerateRows="False" 
                            CellPadding="4" DataKeyNames="CustID" 
                            DataSourceID="CusDetDs" ForeColor="#333333" GridLines="None" 
                            AllowPaging="True" 
                            
                            
                            
                            
                            
                            
                            style="top: -73px; left: 241px; position: absolute; height: 352px; width: 173px;">
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <CommandRowStyle BackColor="#D1DDF1" Font-Bold="True" />
                            <RowStyle BackColor="#EFF3FB" />
                            <FieldHeaderStyle BackColor="#DEE8F5" Font-Bold="True" />
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <Fields>
                                <asp:BoundField DataField="CustID" HeaderText="ID" InsertVisible="False" 
                                    ReadOnly="True" SortExpression="CustID" />
                                <asp:BoundField DataField="CustName" HeaderText="Customer Name" 
                                    SortExpression="CustName" />
                                <asp:BoundField DataField="CustAddr1" HeaderText="Address1" 
                                    SortExpression="CustAddr1" />
                                <asp:BoundField DataField="CustAddr2" HeaderText="Address2" 
                                    SortExpression="CustAddr2" />
                                <asp:BoundField DataField="CustAddr3" HeaderText="Address3" 
                                    SortExpression="CustAddr3" />
                                <asp:BoundField DataField="CustCity" HeaderText="City" 
                                    SortExpression="CustCity" />
                                <asp:BoundField DataField="CustState" HeaderText="State" 
                                    SortExpression="CustState" />
                                <asp:BoundField DataField="CustCountry" HeaderText="Country" 
                                    SortExpression="CustCountry" />
                                <asp:BoundField DataField="CustPhone" HeaderText="Phone" 
                                    SortExpression="CustPhone" />
                                <asp:BoundField DataField="CustMobile" HeaderText="Mobile" 
                                    SortExpression="CustMobile" />
                                <asp:BoundField DataField="CustFax" HeaderText="Fax" SortExpression="CustFax" />
                                <asp:BoundField DataField="CustEmail" HeaderText="Email" 
                                    SortExpression="CustEmail" />
                                <asp:BoundField DataField="CustZipCode" HeaderText="ZipCode" 
                                    SortExpression="CustZipCode" />
                                <asp:BoundField DataField="CustLeadTime" HeaderText="LeadTime" 
                                    SortExpression="CustLeadTime" />
                                <asp:BoundField DataField="CustStatus" HeaderText="Status" 
                                    SortExpression="CustStatus" />
                            </Fields>
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <EditRowStyle BackColor="#2461BF" />
                            <AlternatingRowStyle BackColor="White" />
                        </asp:DetailsView>
                        <asp:SqlDataSource ID="CusDetDs" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:TimeTrackerConnectionString30 %>" 
                            SelectCommand="SELECT * FROM [CustomerMaster] WHERE ([CustID] = @CustID)">
                            <SelectParameters>
                                <asp:ControlParameter ControlID="ddrCustID1" Name="CustID" 
                                    PropertyName="SelectedValue" Type="Int32" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                    </p>
                    
                    
                   
                   
            </td>
            </tr>
            </table>
            
                         
            
      <p style="height: 13px; top: 849px; left: 25px; position: absolute; width: 1334px">     
                         
            
            <asp:Label ID="lblWarn" runat="server" Text="* Required Fields" 
                ForeColor="Red"></asp:Label>
            
         </p>                
            
            
                         
            
            
        </fieldset>
    </div>

</asp:Content>




